//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by FernFlower decompiler)
//

package com.example.mall.dto;

import com.example.mall.mbg.model.Indicator;
import com.example.mall.mbg.model.Supplier;
import com.example.mall.mbg.model.Weight;

import java.text.SimpleDateFormat;

public class WeightDto extends Weight {
    private Supplier supplier;
    private Indicator indicator;

    public WeightDto(Weight weight) {
        this.setWeightid(weight.getWeightid());
        this.setSupplierid(weight.getSupplierid());
        this.setIndicatorid(weight.getIndicatorid());
        this.setWeightvalue(weight.getWeightvalue());
        this.setCreatetime(weight.getCreatetime());
        this.setUpdatetime(weight.getUpdatetime());
    }

    public void setSupplier(Supplier supplier) {
        this.supplier = supplier;
    }

    public Supplier getSupplier() {
        return this.supplier;
    }

    public void setIndicator(Indicator indicator) {
        this.indicator = indicator;
    }

    public Indicator getIndicator() {
        return this.indicator;
    }

    public String getFmtCreateDate() {
        if (getCreatetime() != null) {
            SimpleDateFormat f = new SimpleDateFormat("yyyy/MM/dd");
            return f.format(getCreatetime());
        } else {
            return "";
        }
    }

    public String getFmtWeightvalue() {
        return getWeightvalue()+"%";
    }

}
